package me.eleme.anubis.openapi.api.exception;

/**
 * @author liuzhiyong
 */
public class ServiceException extends Exception {
    private static final long serialVersionUID = 126576857604542350L;
    private String code;

    private String apiCode;

    private String apiMsg;

    public ServiceException() {
        super("业务异常，请重试");
    }

    public ServiceException(String message) {
        super(message);
    }

    public ServiceException(String code, String message) {
        this(message);
        this.setCode(code);
    }

    public ServiceException(String code,String apiCode, String apiMsg,String message) {
        this(message);
        this.setCode(code);
        this.setApiCode(apiCode);
        this.setApiMsg(apiMsg);
    }

    public ServiceException(String code, String message, Throwable cause) {
        super(message, cause);
        this.setCode(code);
    }



    public ServiceException(String code, Throwable cause) {
        super(cause);
        this.setCode(code);
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getCode() {
        return this.code;
    }

    public String getApiCode() {
        return apiCode;
    }

    public void setApiCode(String apiCode) {
        this.apiCode = apiCode;
    }

    public String getApiMsg() {
        return apiMsg;
    }

    public void setApiMsg(String apiMsg) {
        this.apiMsg = apiMsg;
    }
}
